<script setup>
defineProps({
  currentPage: String
})

const emit = defineEmits(['change-page'])
</script>

<template>
  <nav class="nav-bar">
    <div class="nav-content">
      <div class="nav-logo">
        <span class="logo-icon">🌱</span>
        知识体系构建
      </div>
      <div class="nav-links">
        <button 
          :class="['nav-item', currentPage === 'list' ? 'active' : '']"
          @click="emit('change-page', 'list')"
        >
          <span class="nav-icon">🗺️</span>
          知识地图
        </button>
        <button 
          :class="['nav-item', currentPage === 'create' ? 'active' : '']"
          @click="emit('change-page', 'create')"
        >
          <span class="nav-icon">✏️</span>
          知识编辑
        </button>
        <button 
          :class="['nav-item', currentPage === 'personal' ? 'active' : '']"
          @click="emit('change-page', 'personal')"
        >
          <span class="nav-icon">📊</span>
          学习洞察
        </button>
      </div>
    </div>
  </nav>
</template>

<style scoped>
.nav-bar {
  background-color: var(--background-light);
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  width: 100%;
}

.nav-content {
  width: 1800px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-item {
  background: none;
  border: none;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

.nav-icon {
  font-size: 1.4rem;
}

.nav-item:hover {
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.nav-item.active {
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  font-weight: 500;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (max-width: 1920px) {
  .nav-content {
    width: 1600px;
  }
}

@media (max-width: 1600px) {
  .nav-content {
    width: 1400px;
  }
}

@media (max-width: 1440px) {
  .nav-content {
    width: 1200px;
  }
}
</style> 